<!DOCTYPE html>
<html>
	<head>
 
<meta charset="UTF-8">
<meta name="copyright" content="www.apicloud.com" />
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
<title>舆情工作平台</title>
<link rel="stylesheet" type="text/css" href="../css/login.css" />
		 <style type="text/css">
       body,html{ width:100%;height:50px;background:#fff; margin:0px; padding:0px;}
        .back{
          border-top: 1px solid #8E8C8C;
          /*display:-webkit-flex; 
          display:-webkit-box; 
          display:-moz-box; 
          display:flex; 
          display:box;*/ 
          width:100%;
          float:right;
          height:50px;
          overflow: hidden;
        }
         
        .back>*{
          display:block;
          -webkit-flex:1;        
          flex:1;
        }
        .back>span>img {
          vertical-align: middle;     
        }
       /*.back>span{ display:block; float:left; width:16.5%; padding-left:20px; height:50px; padding-top:5px;  background:url(../image/btn/cz1.png)  no-repeat center ; background-size:auto 90%;}*/
    </style> 
	</head>
	<body>
       <div id="back" class="back">
           <span style="float:left" id="goback" tapmode="buyhover" onclick="api.closeWin();">
                <img src="../image/btn/left_back.png" height="46">
           </span>
           <!--<span id="kong">
                <img src="../image/btn/kong2.png" height="46">
           </span>-->

	       
	       <span style="float:right" id="fx" tapmode="buyhover" onclick="goto_showMoreMenuFun(99)"></span>
	       <span style="float:right" id="sc" tapmode="buyhover" onclick="goto_userFavoriteFun()"></span>
	       <span style="float:right" id="pl" tapmode="buyhover" onclick="goto_commentFun()"></span> 
	       
       </div>
<!-------------------分享信息---------------------------->
<input id="url" type="hidden" value=""/>
<input id="title" type="hidden" value=""/>
<input id="abstract_content" type="hidden" value=""/>
<input id="is_collect" type="hidden" value=""/>
<!-------------------分享信息---------------------------->
</body>
<script type="text/javascript" src="../script/api.js"></script>  
<script type="text/javascript" src="../script/alpenlicebe.js"></script>   
<script type="text/javascript" src="../script/zepto.min.js"></script>
<script type="text/javascript" src="../script/hashes.min.js"></script> 
 
<script type="text/javascript">
	apiready = function(){
		$("#url").val(api.pageParam.url);
		$("#title").val(api.pageParam.title);
		$("#abstract_content").val(api.pageParam.abstract_content);
		$("#is_collect").val(api.pageParam.is_collect); 
       	$("#pl").html('<img src="../image/btn/comment.png" height="46">');
		if(api.pageParam.is_collect == "未收藏"){
			$("#sc").html('<img src="../image/btn/collected.png" height="46">'); 
		}else{
			$("#sc").html('<img src="../image/btn/already_collected.png" height="46">'); 
		}	
		$("#fx").html('<img src="../image/btn/share.png" height="46">');                    
	}
	
	function goto_userFavoriteFun(){
		var infoID=api.pageParam.infoID;
		if(''==infoID||undefined==infoID||null==infoID){
    		api.alert({title:'系统提示',msg:'参数错误'});
			return;
    	}
    	api.showProgress({
		    style: 'default',
		    animationType: 'fade',
		    title: '',
		    text: '',
		    modal: false
		});
		
		var MD5 = new Hashes.MD5;   
       	var access_token = Alpe_getLocalStorge("access_token");                     
       	var admin_id = Alpe_getLocalStorge("admin_id"); 
       	var sign = MD5.hex(access_token+admin_id+infoID+'datas/setCollect1.0syjqingbao');
            
       	var url = Alpe_ApiUrl+'r=datas/setCollect&access_token='+access_token+'&admin_id='+admin_id
       		+'&message_id='+infoID 
       		+'&v=1.0&sign='+sign;
       	api.ajax({
	         url: url,
	         method: 'get',
	         cache: false,
	         timeout: 30,			
	         dataType: 'json'
       	}, function(ret, err){
       		console.log($api.jsonToStr(ret));
			if (ret) {	 
				if(ret.success == "101"){
	                 var is_collect = $("#is_collect").val(); 
                     if(is_collect == "未收藏"){
				          $("#sc").html('<img src="../image/btn/already_collected.png" height="46">'); 
				          $("#is_collect").val("已收藏");  
				          
				     }else{
				          $("#sc").html('<img src="../image/btn/collected.png" height="46">'); 
				          $("#is_collect").val("未收藏"); 					          
				     } 
                 }
	             api.toast({
			         msg: ret.message,
                     duration:2000,
                     location: 'middle'
       			});
		  		api.hideProgress();
			}else{
				api.alert({title:'系统提示',msg:'错误码：'+err.code+'；错误信息：'+err.msg+'网络状态码：'+err.statusCode});
				api.hideProgress();
			} 
   		});
	}
	
	function goto_showMoreMenuFun(menuType){ 
		
		var infoID=api.pageParam.infoID;
		if(''==infoID||undefined==infoID||null==infoID){
    		api.alert({title:'系统提示',msg:'参数错误'});
			return;
    	}
		var url = $("#url").val();
		var title = $("#title").val();
		var abstract_content = $("#abstract_content").val();
          
        
		if(1==menuType||2==menuType){
			if(99==is_pass||99==pass_status||99==deal_status||99==forwarding_status){
				return;
			} 
		}
		if(99==menuType){
			api.openFrame({
			    name: 'share',
			    url: './share.html',
			    rect:{
			        x:0,
		     		y:0,
		    		w:"auto",
		    		h:"auto"
			    },
			    pageParam: {newsTitle:title, 
						    newsDesc:abstract_content, 
						    newsUrl:url, 
						    newsImg:''},
			    bounces: false,
			    bgColor: 'rgba(0,0,0,0.5)' 
			});
		}
	}
	function goto_commentFun(){
		var hotID=api.pageParam.hotID;
		var infoID=api.pageParam.infoID;
		if(''==infoID||undefined==infoID||null==infoID){
    		api.alert({title:'系统提示',msg:'参数错误'});
			return;
    	}
    	api.openWin({
            name: 'hot_TrackListInfoListDetail_Comment',
            url: './hot_TrackListInfoListDetail_Comment.html',
            bounces: false,
            reload: true,
            rect: {
                x: 0,
                y: 0,
                w: 'auto',
                h: 'auto'
            },
            pageParam: {infoID:infoID,hotID:hotID},
            delay: 200
   		}); 	
	}
</script>
</html>
